home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / c / makeassigns.bak < prev    next >
Text File  |  1996-11-19  |  1KB  |  44 lines

  1. /* $VER: MakeAssigns 1.0 (c) Neil Bothwick  1996               */
  2. /* Sets up or removes system assigns and paths for a CD        */
  3.  
  4. /* Usage: MakeAssigns [REMOVE]                                 */
  5. /* The assigns must be defines in S:CUCDassigns in the format  */
  6. /* AssignName:  Path                                           */
  7. /* and the paths in S:CUCDpaths in the format                  */
  8. /* Path                                                        */
  9.  
  10. parse arg switch
  11.  
  12. if ~open(AssList,'S:CUCDassigns','R') then exit
  13.  
  14. do until eof(AssList)
  15.     Line = readln(AssList)
  16.     if left(Line,1) = ';' then iterate
  17.     if words(Line) ~= 2 then iterate
  18.     parse var Line Name Path .
  19.     cmdstr = 'assign >NIL:' Name Path
  20.     if upper(switch) = 'REMOVE' then cmdstr = cmdstr 'REMOVE'
  21.     address command cmdstr
  22.     end
  23.  
  24. call close(AssList)
  25.  
  26. if ~open(PathList,'S:CUCDpaths','R') then exit
  27.  
  28. do until eof(PathList)
  29.     Line = readln(PathList)
  30.     if left(Line,1) = ';' then iterate
  31.     parse var Line Name Path .
  32.     cmdstr = 'assign >NIL:' Name Path
  33.     if upper(switch) = 'REMOVE' then cmdstr = cmdstr 'REMOVE'
  34.     else CmdStr = CmdStr 'ADD'
  35.     address command cmdstr
  36.     end
  37.  
  38. call close(PathList)
  39.  
  40.  
  41.  
  42. exit
  43.  
  44.